﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LiveCPEWinForm.LiveCPEWS;

namespace LiveCPEWinForm.comp
{
    public partial class CsFriend : UserControl
    {
        public CsFriend(UserWS user)
        {
            InitializeComponent();
            // MAJ
            lblBirth.Text = "Birth Date : "+ Convert.ToString(user.DateOfBirth);
            lblEmail.Text = "Email : "+user.Email;
            lblFirstName.Text = "FirstName : "+user.FirstName;
            lblLastName.Text = "LastName : "+user.LastName;
            lblUser.Text = "(" + user.UserName + ")";
            // Image
            try
            {
                if (user.Picture.Length > 0)
                {
                    System.IO.MemoryStream ms = new System.IO.MemoryStream(user.Picture);
                    pbProfile.Image = System.Drawing.Image.FromStream(ms);

                }
            }
            catch (Exception) { }
        }
    }
}
